﻿@model Beauty.Web.Page.PagedList<Beauty.Model.RequstMoney>
@using Beauty.Web.Page
@{
    ViewBag.Title = "RequestMoney";
}

@Html.Partial("NavSub")

<style>

    .form-horizontal .control-group {
margin-bottom: 0px;
}

    legend
    {
        margin-bottom: 0px;
    }
</style>

@using (Html.BeginForm("BugPoint", "manager", FormMethod.Post, new { @class = "form-horizontal margintop" }))
{

      <fieldset>
        <legend>兑换</legend>
    @Html.ValidationSummary("", new { @class = "text-error" })
       <div class="control-group systemmoney">
        @*<label class="control-label" for="inputEmail">Email</label>*@
       
        <div class="controls red" >
            @*<input type="text" id="inputEmail" placeholder="Email">*@
         @ViewBag.Msg

        </div>
    </div>
    <div class="control-group systemmoney">
        @*<label class="control-label" for="inputEmail">Email</label>*@
        @Html.Label("", new { @class = "control-label" })
        <div class="controls" >
            @*<input type="text" id="inputEmail" placeholder="Email">*@
          @Html.TextBox("money") 元
             <input type="button" value="兑换成现金" class="btn" id="submit" />
        </div>
    </div>
   
   
  
          </fieldset>



      <fieldset>
        <legend>提现</legend>
    @Html.ValidationSummary("", new { @class = "text-error" })
       <div class="control-group systemmoney">
        @*<label class="control-label" for="inputEmail">Email</label>*@
       
        <div class="controls red" >
            @*<input type="text" id="inputEmail" placeholder="Email">*@
         @ViewBag.Msg3

        </div>
    </div>
    <div class="control-group systemmoney">
        @*<label class="control-label" for="inputEmail">Email</label>*@
        @Html.Label("", new { @class = "control-label" })
        <div class="controls" >
            @*<input type="text" id="inputEmail" placeholder="Email">*@
          @Html.TextBox("money2") 元
             <input type="button" value="提现" class="btn" id="submit3" />
        </div>
    </div>
   
   
          </fieldset>



      <fieldset>
        <legend>购买积分</legend>
    @Html.ValidationSummary("", new { @class = "text-error" })
     
    
    <div class="control-group systemmoney">
        @*<label class="control-label" for="inputEmail">Email</label>*@
       
        <div class="controls red" >
            @*<input type="text" id="inputEmail" placeholder="Email">*@
           @ViewBag.Msg2

        </div>
    </div>
    <div class="control-group systemmoney">
        @*<label class="control-label" for="inputEmail">Email</label>*@
        @Html.Label("", new { @class = "control-label" })
        <div class="controls" >
            @*<input type="text" id="inputEmail" placeholder="Email">*@
          @Html.TextBox("point",(object)ViewBag.point) 分
            <input type="button" value="购买" class="btn" id="submit2" />

        </div>
    </div>
   
</fieldset>

  <fieldset>
        <legend>提现记录</legend>
 <table class="table table-bordered table-hover table-condensed text-center">
        <thead>
            <tr>
             
                <th class="centerandmiddle">提现金额</th>
                <th class="centerandmiddle">时间</th>
                <th class="centerandmiddle">结果</th>
            </tr>
        </thead>
        <tbody>
            @for (var i = 0; i < Model.Count; i++)
            {
                <tr>
                   
                    <td class="centerandmiddle">@Model[i].Money</td>

                    <td class="centerandmiddle">@Model[i].Createtime</td>
                    <td class="centerandmiddle">@Model[i].Msg</td>
                </tr>
            }

        </tbody>

    </table>
    <div class="pagination">

        @Html.Pager(Model)
         
    </div>
      </fieldset>
}
<script>
    $(function () {
        $("ul[class='nav'] li[class!='dropdown']").removeClass();
        $("ul[class='nav'] li:eq(5)").addClass("active");

    
        $("ul[class='nav nav-pills'] li:eq(6)").addClass("active");

        $("#submit").click(function () {
            $.ajax({
                url: '/manager/RequestMoneyAdd',
                type: 'POST',
                dataType: 'json',
                data: $.toJSON({ money: $("#money").val() }),
                contentType: 'application/json; charset=utf-8',
                success: function (data) {

                }
            }).done(function (data) {
                if (data.Result) {
                    ShowMsg(data.Msg, function () {
                        location.href = location.href;
                    });
                }
                else {
                    ShowMsg(data.Msg);
                }
            });
        })

        $("#submit3").click(function () {
            $.ajax({
                url: '/manager/RequestMoneyToServer',
                type: 'POST',
                dataType: 'json',
                data: $.toJSON({ money: $("#money2").val() }),
                contentType: 'application/json; charset=utf-8',
                success: function (data) {

                }
            }).done(function (data) {
                if (data.Result) {
                    ShowMsg(data.Msg, function () {
                        location.href = location.href;
                    });
                }
                else {
                    ShowMsg(data.Msg);
                }
            });
        })

        $("#submit2").click(function () {
            $.ajax({
                url: '/manager/BugPoint',
                type: 'POST',
                dataType: 'json',
                data: $.toJSON({ point: $("#point").val() }),
                contentType: 'application/json; charset=utf-8',
                success: function (data) {

                }
            }).done(function (data) {
                if (data.Result) {
                    ShowMsg(data.Msg, function () {
                        location.href = location.href;
                    });
                }
                else {
                    ShowMsg(data.Msg);
                }
            });
        })
       
    })


</script>
